capture log close
log using immigsocwef_google_rep, replace text
//program:  immigsocwef_google_rep.do
//task:    Replication of Google Trends analysis
//project:  Social Welfare Attitudes and Immigrants as a Target Population: Experimental Evidence (Perspectives on Politics)
//author: Jake Haselswerdt \ 2020-6-9

//program setup
version 14
clear all
set linesize 80
macro drop _all
set scheme s1mono
set more off

use immigsocwef_google.dta, clear
tsset yearmonth, monthly

tsline welfarework1319 welfareimmigrants1319 welfareblack1319 if tin(2013m6, 2019m6), legend(ring(0) pos(10) col(1)) xtitle("") lpattern(dash solid dot) yscale(r(0 100)) xmtick(641(1)713) xlabel(641(12)713) /*xscale(r(652 714))*/ plotr(margin(medium)) tline(2015m6, lpattern(shortdash) lcolor(gs12)) ttext(65 2015m6 "Trump announcement", place(w) size(small)) tline(2016m11, lpattern(shortdash) lcolor(gs12)) ttext(65 2016m11 "Presidential election", place(w) size(small)) note(Note: Numbers scaled so highest monthly result is equal to 100.)
graph export Figure1.tif, as(tif) replace

log close
exit
